package cn.web.servlet;

import java.io.IOException;

import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/** 
* @author  作者:袁云 
* @date 创建时间：2017年5月23日 上午11:16:38
*/
public class Servlet3 extends HttpServlet {

	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		// TODO Auto-generated method stub
		System.out.println("doGet()方法被调用----->");
	}

	@Override
	public void destroy() {
		// TODO Auto-generated method stub
		System.out.println("destroy()销毁方法被调用----->");
	}

	@Override
	public void init(ServletConfig config) throws ServletException {
		// TODO Auto-generated method stub
		System.out.println("init()初始化方法被调用----->");
		String value = config.getInitParameter("charsetEncoding");
		System.out.println("init()初始化方法初始化参数----->" + value);
	}

	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		// TODO Auto-generated method stub
		System.out.println("doPost()方法被调用----->");
	}

	@Override
	protected void service(HttpServletRequest arg0, HttpServletResponse arg1) throws ServletException, IOException {
		// TODO Auto-generated method stub
		System.out.println("service()方法派发器，根据请求get/post,调用相应的doGet()和doPost()方法----->");
		super.service(arg0, arg1);
	}

}
